module.exports = {
  // 调用此方法存储想存储的值
  setCache: (key = "", playload) => {
    if (!key || !playload) return
    wx.setStorageSync(key, playload)
  },
  // 调用此方法获取存储的值
  getCache: (key) => {
    if (!key) return
    return wx.getStorageSync(key)
  },
  // 调用此方法删除存储的值
  removeCache: (key) => {
    if (!key) return
    return wx.removeStorageSync(key)
  },
  // 调用此方法存储 用户信息
  setUserInfo: (playload) => {
    if (!playload) return
    return wx.setStorageSync('userInfo', playload)
  },
  // 调用此方法获取 用户信息
  getUserInfo: () => {
    return wx.getStorageSync('userInfo')
  },
  // 调用此方法删除 用户信息
  removeUserInfo: () => {
    return wx.removeStorageSync('userInfo')
  },
  // 调用此方法存储 用户openid
  setOpenID: (playload) => {
    if (!playload) return
    return wx.setStorageSync('get_openid', playload)
  },
  // 调用此方法获取 用户openid
  getOpenID: () => {
    return wx.getStorageSync('get_openid')
  },
  // 调用此方法删除 用户openid
  removeOpenID: () => {
    return wx.removeStorageSync('get_openid')
  },
  // 调用此方法存储 用户身份标识
  setIdentityId: (playload) => {
    if (!playload) return
    return wx.setStorageSync('get_identityId', playload)
  },
  // 调用此方法获取 用户身份标识
  getIdentityId: () => {
    return wx.getStorageSync('get_identityId')
  },
  // 调用此方法删除 用户身份标识
  removeIdentityId: () => {
    return wx.removeStorageSync('get_identityId')
  },

  // 清除本地所有缓存
  clearStorageSync: () => {
    wx.clearStorageSync()
  },
}